'''
继承：
    单继承
    多继承
'''


# 1、单继承
class Fish:
    def swim(self):
        print('我会游泳')


class GlodFish(Fish):
    def tupaopao(self):
        print('我会吐泡泡')


gold_fish = GlodFish()
gold_fish.swim()
gold_fish.tupaopao()


# 多继承
class Fish:
    def swim(self):
        print('我会游泳')


class Bird:
    def fly(self):
        print('我会飞')


class FlyFish(Fish, Bird):
    def fly(self):  # 重写
        print('我是滑翔的')


fly_fish = FlyFish()
fly_fish.swim()
fly_fish.fly()

# 扩展一下：如果子类想调用父类的构造方法，怎么办？（掌握一下）
print('--------------华丽丽-------------')


class Fish:
    def __init__(self, category):
        self.category = category
        print(f'我的{category}类')

    def swim(self):
        print('我会游泳')


class GlodFish(Fish):
    def __init__(self, category):
        super().__init__(category)  # super()调用父类的构造方法

    def tupaopao(self):
        print('我会吐泡泡')


gold_fish = GlodFish('鱼')

# 扩展一下：如果子类想调用多个父类的构造方法，怎么办？（了解一下）
print('--------------华丽丽-------------')


class Fish:
    def __init__(self, category):
        self.category = category
        print(f'我的{category}类')

    def swim(self):
        print('我会游泳')


class Bird:
    def __init__(self, category):
        self.category = category
        print(f'我的{category}类')

    def fly(self):
        print('我会飞')


class FlyFish(Fish, Bird):
    def __init__(self, *args):
        super().__init__(args)


fly_fish = FlyFish('鱼', '飞鱼')
